// 二次封装 uni.request

const BASE_URL = 'http://127.0.0.1:8082'
export const myRequest = (options) => {
	return new Promise((resolve,reject) => {
		uni.request({
			url: BASE_URL + options.url,
			method: options.method || 'GET',
			data: options.data || {},
			success:(response)=>{
			if(response.data.status !==0){
				return uni.showToast({
					title:'获取失败'
				})
			}
			resolve(response)
			},
			fail:(err)=>{
				 uni.showToast({
					title:'请求接口失败'
				})
			reject(err)
			}
		})
	})
}
